package com.troll.wanandroid.design.activity

import android.os.Bundle
import android.webkit.WebSettings
import android.webkit.WebView
import androidx.appcompat.app.AppCompatActivity
import com.troll.wanandroid.R


/**
 *
 * @Author:   TangPeng
 * @Time:     2/4/21
 * @Remark: 网页Link
 */
class LinkActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_link)
        val web = findViewById<WebView>(R.id.link_web)
        intent.getStringExtra("link")?.let {
            web.loadUrl(it)
        }
        val webSettings: WebSettings = web.settings
        webSettings.javaScriptEnabled = true
        webSettings.useWideViewPort = true;
        webSettings.loadWithOverviewMode = true
    }
}